#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
int main()
{
	int n, flag = 1;
	scanf("%d", &n);

	for (int i = 2; i <= sqrt(n); i++)
		if (n % i == 0)
			flag = 0;
	
	if (flag == 1 && n != 1)  //注意:1不是素数
		printf("YES");
	else
		printf("NO");
	return 0;
}